package com.zlcx.tz.live.enums;

/**
 * @AUTHOR xhl
 * @CREATE 2019-04-18 16:10
 **/
public enum RoomState {

    LIVING( "直播中上麦未满员", 1),
    FULL( "直播中上麦已满员", 2),
    CLOSED( "已解散", 3),
    BE_CLOSED( "强制解散", 4),
    SYS_CLOSED( "系统解散,下课时间到", 5),
    HEART_MISS_CLOSED( "心跳丢失关闭房间", 6),
    ;

    RoomState( String tips, int code) {
        this.tips = tips;
        this.code = code;
    }

    private String tips;
    private int code;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getTips() {
        return tips;
    }

    public void setTips(String tips) {
        this.tips = tips;
    }

    public static RoomState getRoomState(int code) {
        for (RoomState field : RoomState.values()) {
            if (code == field.getCode()) {
                return field;
            }
        }
        return null;
    }
}
